package 线程的第三种实现方式;

import java.util.concurrent.FutureTask;

public class 测试类 {
    public static void main(String[] args) throws Exception{
        MyCallable myCallable = new MyCallable();
        FutureTask<Object> futureTask = new FutureTask<>(myCallable);
        Thread thread = new Thread(futureTask);
        thread.start();
        //System.out.println(futureTask.get());
        Object result = futureTask.get();
        System.out.println(result);
    }
}
